package com.test.mywebtest.Enum;

public enum GDFileEnum {

    FJ(0,"附件"),
    ZW(1,"正文"),
    GZ(2,"稿纸"),
    BLD(3,"办理单"),
    FWGZ(4,"发文稿纸"),
    DG(5,"定稿"),
    LCRZ(6,"流程日志"),
    GWCLD(7,"公文处理单");

    private int code;
    private String description;

    GDFileEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    // 根据代码值获取对应的枚举实例
    public static GDFileEnum fromCode(int code) {
        for (GDFileEnum type : GDFileEnum.values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid document type code: " + code);
    }
}
